//
//  RVCheckstandController.swift
//  AirTravel
//
//  Created by apple on 2021/11/22.
//

import UIKit

class RVCheckstandController: CommonVC {

    
    @IBOutlet weak var priceLabel: UILabel!
    
    @IBOutlet weak var wechatBtn: UIButton!
    
    @IBOutlet weak var offLineBtn: UIButton!
    
    @IBOutlet weak var tableView: UITableView!
    
    @IBOutlet weak var conftirmBtn: UIButton!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        head.title.text = "收银台"
        confUI()
    }

    func confUI(){
        wechatBtn.isSelected = true
        tableView.isHidden = true
        view.backgroundColor = UIColor(hexString: "FAFAFA");
        conftirmBtn.setBtnGradient()
        tableView.allowsSelection = false
        tableView.rowHeight = 410
        tableView.separatorStyle = .none
        tableView.register(UINib(nibName: "RVOfflinnePayCell", bundle: nil), forCellReuseIdentifier: "offline_list")
    }

    @IBAction func clickConfirmBtn(_ sender: UIButton) {
    }
    
    @IBAction func clickWechatBtn(_ sender: UIButton) {
        if sender.isSelected {
            return
        }
        
        sender.isSelected = true
        tableView.isHidden = true
        offLineBtn.isSelected = false
        
        
    }
    @IBAction func clickOfflineBtn(_ sender: UIButton) {
        if sender.isSelected {
            return
        }
        
        sender.isSelected = true
        tableView.isHidden = false
        wechatBtn.isSelected = false
    }
}

extension RVCheckstandController: UITableViewDelegate, UITableViewDataSource{
    
    func numberOfSections(in tableView: UITableView) -> Int {
        1
    }
    
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        1
    }
    
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCell(withIdentifier: "offline_list", for: indexPath) as! RVOfflinnePayCell
        return cell
    }
    
}
